<?php
/**
 *	@author: Jacken
 *	
 * 	- Connect to database.
 *	- Set charset to insert Unicode Data.
 */
class Connect {

	private $host = "localhost";
	private $userName = "root";
	private $passWord = "";
	private $dataBase = "video_chat";
	private $mysqli;

	function Connect() {
		
	}

	function getConnect() {
		//Connect to video_chat database.
		$this->mysqli = mysqli_connect($this->host, $this->userName, $this->passWord, $this->dataBase) 
					or die("Failed to connect to MySql: " .mysqli_connect_error());

		// Set charset.
		mysqli_query($this->mysqli, "SET CHARACTER SET 'UTF8'");

		// Execute SQL Insert, Update, Delete query .
		//$mysqli->query($query);
	}

	function getMysqli() {
		$this->getConnect();

		return $this->mysqli;
	}
}
?>